home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Visual Basic Source Code
/
Visual Basic Source Code.iso
/
vbsource
/
favori
/
favorit1.frm
< prev
next >
Wrap
Text File
|
1995-05-08
|
18KB
|
596 lines
VERSION 2.00
Begin Form Form1
BackColor = &H0080C0FF&
Caption = "Favorite Program Launcher"
ClientHeight = 3990
ClientLeft = 375
ClientTop = 2085
ClientWidth = 7845
FontBold = -1 'True
FontItalic = 0 'False
FontName = "Courier"
FontSize = 9.75
FontStrikethru = 0 'False
FontUnderline = 0 'False
ForeColor = &H00000000&
Height = 4680
Icon = FAVORIT1.FRX:0000
Left = 315
LinkMode = 1 'Source
LinkTopic = "Form1"
ScaleHeight = 3990
ScaleWidth = 7845
Top = 1455
Width = 7965
Begin CommandButton DosButton
Caption = "Shell to DOS"
Height = 375
Left = 240
TabIndex = 2
Top = 3240
Width = 2895
End
Begin CommandButton CancelButton
Caption = "Cancel"
Height = 495
Left = 6720
TabIndex = 7
Top = 3120
Visible = 0 'False
Width = 855
End
Begin CommandButton OKButton
Caption = "OK"
Height = 495
Left = 5280
TabIndex = 6
Top = 3120
Visible = 0 'False
Width = 855
End
Begin CheckBox Check1
BackColor = &H0080C0FF&
Caption = "Check1"
Height = 255
Left = 720
TabIndex = 1
Top = 3000
Width = 255
End
Begin TextBox CommandlineName
BackColor = &H00E0FFFF&
FontBold = -1 'True
FontItalic = 0 'False
FontName = "MS Sans Serif"
FontSize = 9.75
FontStrikethru = 0 'False
FontUnderline = 0 'False
Height = 375
Left = 5280
TabIndex = 5
Top = 2040
Visible = 0 'False
Width = 2295
End
Begin CommandButton BrowseButton
BackColor = &H00C0C0C0&
Caption = "Pick A File"
Height = 495
Left = 6000
TabIndex = 4
Top = 960
Width = 1095
End
Begin ListBox List1
BackColor = &H00E0FFFF&
FontBold = -1 'True
FontItalic = 0 'False
FontName = "MS Sans Serif"
FontSize = 12
FontStrikethru = 0 'False
FontUnderline = 0 'False
Height = 2130
Left = 600
Sorted = -1 'True
TabIndex = 0
Top = 720
Width = 2295
End
Begin TextBox PetName
BackColor = &H00E0FFFF&
FontBold = -1 'True
FontItalic = 0 'False
FontName = "MS Sans Serif"
FontSize = 12
FontStrikethru = 0 'False
FontUnderline = 0 'False
Height = 420
Left = 5400
TabIndex = 3
Top = 240
Visible = 0 'False
Width = 1935
End
Begin PictureBox Picture1
Height = 495
Left = 1560
Picture = FAVORIT1.FRX:0302
ScaleHeight = 465
ScaleWidth = 465
TabIndex = 11
Top = 120
Width = 495
End
Begin Label Checklabel
BackColor = &H0080C0FF&
Caption = "Minimize on Launch"
Height = 255
Left = 1080
TabIndex = 8
Top = 3000
Width = 1815
End
Begin Label CommandlineLabel
BackColor = &H0080C0FF&
Caption = "Command Line"
Height = 255
Left = 3960
TabIndex = 10
Top = 2160
Visible = 0 'False
Width = 1455
End
Begin Label Filenamelabel
BackColor = &H00C0E0FF&
BorderStyle = 1 'Fixed Single
Height = 255
Left = 4560
TabIndex = 12
Top = 1560
Width = 3255
End
Begin Label PetnameLabel
Alignment = 2 'Center
BackColor = &H0080C0FF&
Caption = "Pet Name"
Height = 255
Left = 4080
TabIndex = 9
Top = 480
Visible = 0 'False
Width = 1095
End
Begin Menu AddMenu
Caption = "&Add"
End
Begin Menu ChangeMenu
Caption = "&Change"
End
Begin Menu DeleteMenu
Caption = "&Delete"
End
Begin Menu UndeleteMenu
Caption = "&Undelete"
End
Begin Menu HelpMenu
Caption = "&Help"
Begin Menu HelpKey
Shortcut = {F1}
Visible = 0 'False
End
End
Begin Menu AboutMenu
Caption = "&About"
End
End
'GLOBALS TO FORM
Dim MAINTSWITCH As String 'tells if "A"dd or "C"hange
Dim TRUEFALSE As Integer 'used in subrte to swap visibility
Dim FIRSTSWITCH As String 'used at load time for initialization
Dim INIDATA As String 'work area
Dim DELETEDITEMS(100) As String 'array saves prior deletes
' for UNDELETE menu item
' display the "About" menu (Form3) when menu item clicked
Sub AboutMenu_Click ()
Load Form3 'load the form
Form3.visible = True 'make it visible
Form3.COMMAND1.SetFocus 'change focus to forms "OK" button
End Sub
'adds and changes to list of programs and FAVORITE.INI file
'are processed here
'
Sub add_to_list ()
If MAINTSWITCH = "C" Then 'came here by "C"hange
WORKITEM% = List1.listindex 'find item in list1 array
End If
If LTrim$(RTrim$(Petname.text)) = "" Then
Beep 'user didn't enter PETNAME
response% = MsgBox("Enter information in Pet Name or Cancel your change.", 64, "Message")
Petname.SetFocus 'put cursor back at PETNAME
Exit Sub
ElseIf LTrim$(RTrim$(RUNFILENAME$)) = "" Then
Beep 'user didn't enter PROGRAMNAME
response% = MsgBox("Enter program name information or Cancel the change.", 64, "Message")
Commandlinename.SetFocus 'put cursor back at PROGRAMNAME
Exit Sub
End If
WORK% = Len(Petname.text) 'align the entered data so it
If WORK% >= 20 Then 'can be placed in list1 and .INI file
DATAWORK$ = UCase$(Left$(Petname.text, 20))
Else
DATAWORK$ = UCase$(Petname.text + String$(20 - WORK%, " "))
End If
WORK% = Len(RUNFILENAME$)
DATAWORK$ = DATAWORK$ + String$(10, " ") + RUNFILENAME$ + String$(50 - WORK%, " ")
WORK% = Len(Commandlinename.text) 'align COMMANDLINE
If WORK% >= 32 Then
DATAWORK$ = DATAWORK$ + Left$(Commandlinename.text, 32)
Else
DATAWORK$ = DATAWORK$ + Commandlinename.text + String$(32 - WORK%, " ")
End If
If MAINTSWITCH = "C" Then 'if change, remove old item from List1
List1.RemoveItem WORKITEM%
End If
MAINTSWITCH = "" 'not needed any further, clear
List1.AddItem DATAWORK$ 'add to list1
Writefile 'go to subrte to write FAVORITE.INI file
Make_Boxes_Visible (False) 'hide the right side boxes & buttons
Clear_the_fields 'clear the box texts
End Sub
Sub AddCtl_Click ()
List1.visible = True 'make right side of form visible
Mak